<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .list {
            width: 300px;
            min-height: 300px;

        }
    </style>
</head>

<body>
    <ul class="list">

    </ul>

    <script>
        const ul = document.querySelector('.list')
        const items = ['a', 'b', 'c', 'd', 'e',]

        // 文档碎片
        // let frg = document.createDocumentFragment()

        // 克隆
        const cloneUl = ul.cloneNode(true)
        for (let i = 0; i < items.length; i++) {
            const li = document.createElement('li')
            li.textContent = items[i]
            cloneUl.appendChild(li)
            // frg.appendChild(li)
        }
        // ul.appendChild(frg)
        ul.parentNode.replaceChild(cloneUl, ul)

    </script>
</body>

</html>